//=================== Configuration =====================

blogApp.config(function($stateProvider,$urlRouterProvider) {

    $urlRouterProvider.otherwise('/');
    $stateProvider
        .state('list', {
            url:"/",
            views: {
                "menu": {templateUrl:'views/menu.html'},
                "body": {templateUrl:"entry/views/viewlist.html",
                         controller:'EntryList'},
                "commentForm@list": {templateUrl:'comments/views/commentForm.html',
                                     controller:'showCommentFormCtrl'},
                "commentList@list": {templateUrl:'comments/views/commentList.html',
                                     controller:'commentListCtrl'}
            }
        })
        .state('entry', {
            url:"/entry/:entryId",
            views: {
                "menu": {templateUrl:'views/menu.html'},
                "body": {templateUrl:"entry/views/modifyEntry.html",
                         controller:'modifyEntry'},
                "commentSection": {templateUrl:'comments/views/commentListDel.html',
                                   controller:'commentListDelCtrl'}
            }
        })
        .state('listAdmin', {
            url:"/",
            views: {
                "menu": {templateUrl:'views/menu.html'},
                "body": {templateUrl:"entry/views/viewlistAdmin.html",
                         controller:'EntryList'},
                "commentList@listAdmin": {templateUrl:'comments/views/commentListDel.html',
                                     controller:'commentListDelCtrl'}
            }
        })
        .state('addEntry', {
            url:"/",
            views: {
                "menu": {templateUrl:'views/menu.html'},
                "body": {templateUrl:"entry/views/addEntry.html"}
            }
        })
        .state('login', {
            url:"/login",
            views: {
                "menu": {templateUrl:'views/menu.html'},
                "body": {templateUrl:'authentification/views/login.html'}
            }
        })
        .state('comment', {
            url:"/comment/:entryId",
            views: {
               "menu": {templateUrl:'views/menu.html'},
               "body": {templateUrl:'comments/views/commentForm.html',
                        controller:'showCommentFormCtrl'}
           }
        })
});





/* ngRoute configuration
blogApp.config(['$routeProvider',
   function($routeProvider) {
    $routeProvider.
    when('/data', {
      templateUrl: 'views/viewlist.html',
      controller: 'EntryList'
    }).
    when('/data/:entryId', {
        templateUrl: 'views/modifyEntry.html',
        controller: 'modifyEntry'
    }).
    otherwise({
      redirectTo: '/data'
    });
   }]);
*/
